// components/base/bank-picker/index.js
const componentBehavior = require('../../../behaviors/component');
const { COMPONENT_OPTIONS } = require('../../../constants/common');
const { BANK_LIST } = require('../../../constants/bank');

Component({
    behaviors: [componentBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        show: {
            type: Boolean,
            value: false,
        },
        closeOnClickOverlay: {
            type: Boolean,
            value: true,
        },
        defaultIndex: {
            type: Number,
            value: 0,
        },
    },
    data: {
        bankList: BANK_LIST,
    },
    methods: {
        handleClose() {
            this.setData({
                show: false,
            });
            // this.triggerEvent('close');
        },
        handleConfirm(e) {
            this.handleClose();
            this.triggerEvent('confirm', e.detail);
        },
    }
})

